<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
	<style type="text/css">
		
		h1:before{
			content: '第'counter(mycounter) '章';
		}
		h1{
			counter-increment: mycounter;
			counter-reset: mycounter2;
		}
		
		h2:before{
			content: '第'counter(mycounter2) '章';
		}
		h2{
			counter-increment: mycounter2;
			margin-left: 40px;
		}
		
	
	</style>
</head>
<body>
	

	<h1>Head1</h1>
	<h2>Text1</h2>
	<h2>Text1</h2>
	<h1>Head2</h1>
	<h2>Text1</h2>
	<h2>Text1</h2>
	<h1>Head3</h1>
	<p>Text3</p>

</body>
</html>

<!-- doesn't work -->